<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="Public/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="Public/Flat/dist/css/flat-ui.css" rel="stylesheet">
	    <link href="Public/Flat/docs/assets/css/demo.css" rel="stylesheet">
	    <link rel="shortcut icon" href="Public/Flat/img/favicon.ico">
	    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="dist/js/vendor/html5shiv.js"></script>
	      <script src="dist/js/vendor/respond.min.js"></script>
	    <![endif]-->
	    
	</head>
	<body>
		<form action="" method="post" enctype="multipart/form-data">
			
		<div class="alert alert-success">编辑友链</div>
		<div class="form-group">
			<label for="exampleInputEmail1">名称</label>
			<input id="exampleInputEmail1" class="form-control" type="text" placeholder="请输入名称" required="" name="lname" value="<?php echo $oldData['lname']?>">
		</div>
		<!--logo-->
		
		<!--缩略图js-->
			<script type="text/javascript" src="Public/jquery-1.8.2.min.js"></script>
			<script  type="text/javascript" charset="utf-8">
				$(function(){
						$(".close_img").click(function(){
							//移除图片
							$(".img_div").remove();
							//添加input
							$(".file_div").html('<input id="exampleInputEmail1" class="form-control" type="file"  name="logo">');
						})
					})
				
			</script>
		
		
		<div class="form-group">
				<label for="exampleInputEmail1">logo</label>
				<!--如果有文件上传-->
				<?php if($oldData['logo']){?>
                
					<div class="img_div">
						<!--显示上传的缩略图-->
						<img src="<?php echo $oldData['logo']?>"/>
						<a href="javascript:;" class="close_img">X</a>
						<input type="hidden" name="thumb" id="thumb" value="<?php echo $oldData['logo']?>" />
					</div>
				<?php }else{?>
					<input id="exampleInputEmail1" class="form-control" type="file"  name="logo">
				
               <?php }?>
				<div class="file_div">
					
				</div>
			</div>
			
				

		<div class="form-group">
			<label for="exampleInputEmail1">url地址</label>
			<input id="exampleInputEmail1" class="form-control" type="text" required="" placeholder="请输入url地址" name="url"  value="<?php echo $oldData['url']?>">
		</div>
		
		<div class="form-group">
			<label for="exampleInputEmail1">排序</label>
			<input id="exampleInputEmail1" class="form-control" type="text" placeholder="请输入分类排序" required="" name="sort" value="<?php echo $oldData['sort']?>">
		</div>
		
	
		<button class="btn btn-primary btn-block" type="submit"> 确定编辑 </button>
		</form>
	</body>
</html>
